import apiClient from "../config/request"
function getAllTaskByUserId(){
    return apiClient({
        url:`/task/getAllTaskByUserId`,
        method:'get',
    })
}
function getTaskByUserIdByType(taskType){
    return apiClient({
        url:`/task/getTaskByUserIdByType/${taskType}`,
        method:'get',
    })
}
function getTaskByUserIdByName(name){
    return apiClient({
        url:`/task/getTaskByUserIdByName/${name}`,
        method:'get',
    })
}
function createTask(data){
    return apiClient({
        url:`/task`,
        method:'post',
        data
    })
}
function updateTask(data){
    return apiClient({
        url:`/task`,
        method:'put',
        data
    })
}
function deleteTask(taskId){
    return apiClient({
        url:`/task/deleteTask/${taskId}`,
        method:'delete',
    })
}
export {getAllTaskByUserId,getTaskByUserIdByType,getTaskByUserIdByName,createTask,updateTask,deleteTask}
